package cn.serenedream.housedecoration.entity;

import jakarta.persistence.*;
import org.springframework.lang.Nullable;
import java.util.Date;

@Entity
public class Sale {
    @Id
    private Long id;

    @Nullable
    private Double price;
    @Nullable
    private Date createDate;

    @OneToOne
    private User user;

    public Sale() {
    }

    public Sale(Long id, Double price, Date createDate, User user) {
        this.id = id;
        this.price = price;
        this.createDate = createDate;
        this.user = user;
    }

    /**
     * 获取
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取
     * @return price
     */
    public Double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(Double price) {
        this.price = price;
    }

    /**
     * 获取
     * @return createDate
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * 设置
     * @param createDate
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * 获取
     * @return user
     */
    public User getUser() {
        return user;
    }

    /**
     * 设置
     * @param user
     */
    public void setUser(User user) {
        this.user = user;
    }

    public String toString() {
        return "Sale{id = " + id + ", price = " + price + ", createDate = " + createDate + ", user = " + user + "}";
    }
}
